Repository navigation
sweetfb_nowait: present state machine codec + host test, copied into the ios-27 tree; PRESENT.md section 6 - #365
Conversation
… copy into the ios-27 tree, PRESENT.md section 6 drivers/display/sweetfb/hakios.sweetfb_present.h is the state machine of the framebuffer stand-in's vsync tick that does not sleep for the GPU (sweetfb_nowait=1, the xnu fork's iokit/Kernel/arm/SweetFramebuffer.cpp): a frame is recorded by a swap, replaced by a newer swap, shown by the first tick after its chains are done, and taken by the old sleeping path after 4 ticks with the GPU idle (a logic error, logged once) or 30 ticks with the GPU busy, so a wrong state is a log line, never a black screen. profiles/ios-27.copy puts it next to SweetFramebuffer.cpp. tools/sweetfb-present-test.sh runs tools/sweetfb_present_test.c under ASan and UBSan in CI: random schedules of swaps, the two-in-flight SwapEnd hold, GPU completions and stalls, ticks and display off/on; it checks that only finished frames are shown, in order, that each swap is released once, that nothing is stranded once the GPU drains, and that the self-check is quiet when the done number is honest and acts when it is stuck. docs/ios27/PRESENT.md section 6 writes the states down and what the first attempt's log shows. Needs the fork commit that uses it. NOT run on a phone.
…(the previous commit regenerated them without the device repositories synced)
|
Phone 1 result for this kernel (nw2, sha256 040ae212…; E1 bench line + sweetfb_prof=1 sweetfb_nowait=1; 17 Nov 23:20):
Why. CoreAnimation's swap rate does not change: about 27 swaps/s while swiping, with or without nowait. backboardd paces on its own CADisplayTimer; it never registers our type-5 vsync (see the sweetfb_cav comment in SweetFramebuffer.cpp), so a steady tick gains nothing. The loss comes from replaced frames, 43-64 per 5 s. swap N+1 is held until frame N's chains are done, and it is recorded the instant they are. So N is replaced unless a tick happens to fall in that gap. Stage times on the old path (sp2's sweetfb_trace, 92 swaps):
CA idles about 20 ms per frame. That fits CA starting frame N+1 at the first 60 Hz timer after frame N is done on the GPU. The limit is CPU encode plus GPU time per frame, not the present. Do not enable sweetfb_nowait. Keep these PRs as draft: the state machine, the host test and the self-check are correct, but they give no fps. Close them, or keep the self-check for a later present design. |
The present state machine for the framebuffer's vsync tick that does not sleep for the GPU (
sweetfb_nowait=1). It is a plain-C codec,drivers/display/sweetfb/hakios.sweetfb_present.h, copied next to the fork's SweetFramebuffer.cpp byprofiles/ios-27.copy.tools/sweetfb-present-test.shis in CI. It runs 300 random seeds × 3 modes under ASan/UBSan: honest, GPU stalls, and a stuck done number. It checks four things:Needs the xnu fork commit from the matching fork PR (branch
agent/scion-swipe2/present); pinfork_commitafter merging. It has NOT been run on a phone yet.🤖 Generated with Claude Code